Cell Spacing in tables

Cell Spacing in tables

by Wayne Foster -
Number of replies: 1

Hello again,

Still struggling with tables. We are using moodle 2.3. I've inserted a table into a page and I want each cell in the table to have some space around it and each cell to have a border. Thanks to the moodle community I've worked out how to do borders around cells but I can't work out how to do spaces around each cell. Adjusting the Cell Spacing value in the Table Properties pop up separates the cells in the editor but when I click Save And Display, the cells are all close together.

Thanks for your help,

Wayne. 

Average of ratings: -
In reply to Wayne Foster

Re: Cell Spacing in tables

by Florian Zillner -

have a look at cellpadding:

this is and
- cellpadding cellspacing
- set to 5 set to 0

best way would be to apply a css-class to the whole table and your done.

anyway, this is the html for the above table:

<table style="border: 1px solid #000000;" border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td style="border: 1px solid #000000;">this</td>
<td style="border: 1px solid #000000;">is</td>
<td style="border: 1px solid #000000;">and</td>
</tr>
<tr>
<td style="border: 1px solid #000000;">-</td>
<td style="border: 1px solid #000000;">cellpadding</td>
<td style="border: 1px solid #000000;"><span>cellspacing</span></td>
</tr>
<tr>
<td style="border: 1px solid #000000;">-</td>
<td style="border: 1px solid #000000;">set to 5</td>
<td style="border: 1px solid #000000;">set to 0</td>
</tr>
</tbody>
</table>