0

I am trying to place padding for the table so that it looks good. but how?

index.php

<table border="0" width="300px">
<tr style="background-color:#ede6c9; color: black;">
<td>
<?php

// How can we help

$result = mysql_query("SELECT * FROM `static_page` WHERE post_id='27'") or die(mysql_error());

echo '<td>';
while ($data = mysql_fetch_array($result)){
       $isi = $data['isi_berita'];
       echo '<h2>'.$data['judul'].'</h2><br><br>';
       echo substr($isi, 0, 1000).'<br>';
}

?>
</td>
</tr>
</table>

Edited by diafol: Wrong forum - AGAIN!

5
Contributors
6
Replies
35
Views
2 Years
Discussion Span
Last Post by raykevinnn
0

Do you mean padding:5px;? You can apply padding to the table, table rows, table cells, etc. You might need to explain a little more, or perhaps provide some example.

0

I know the code, I just do not know where to place the padding at? (so that the code shows exactly like as it suppose to be)

0

so that the code shows exactly like as it suppose to be

Eh? I'm not really sure what you mean by the above comment. You set the padding on the element you want padding on, there really isn't anywhere it is "supposed to be". Or are you asking if you should put it inline (like you already did with your table row), or in a stylesheet (like you really should be doing).

0

@davy_yg

For the millionth time - please stop posting every single question into the PHP forum - and I've repeatedly shown/told you how/why to style with css.

Do you ever take notice of anything we tell you?

Sorry, I am feeling grumpy, but come on.

Post moved...

Edited by diafol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.