Solved Help with cellpadding in multicell table.

January 21, 2013 at 14:39:36
Specs: Windows 7
Does cellpadding attribute in table tag extend to all cells? Or does the attribute need to be defined in each cell?

See More: Help with cellpadding in multicell table.

Report •

January 22, 2013 at 08:22:14
✔ Best Answer
Should be defined with the border I would say by this logic it should be applied to the whole table.

<table border="1" cellpadding="5">

:: mike

Report •

January 29, 2013 at 09:30:09
Cellpadding and cellspacing attributes all apply to all cells within that table, so to add to mikelinus' answer on this:

<table border="1" cellpadding="5" cellspacing="0">

Would affect everything that comes after right up to </table>. However, bear in mind that it won't affect nested tables. So the following code:

<table border="1" cellpadding="5" cellspacing="2">
<tr><td><table border="5"><tr><td>Test</td></tr></table>

..would give you a table within a table that has the default attributes, not inherited from the parent table.

Hope this answers your question!

Report •
Related Solutions

Ask Question