473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

cellpadding definition in HTML/CSS ?

For a table cell I want to have a padding of 3 pixel between the cell border and the text inside.
How do I specify this attribute in a <TD> resp. css ?

Mark

Jul 20 '05 #1
10 9966
Mark Richards wrote:
For a table cell I want to have a padding of 3 pixel between the cell border and the text inside.
How do I specify this attribute in a <TD> resp. css ?


td{
padding:3px;
}

For cellspacing:
<http://annevankesteren.nl/test/examples/tweakers/post-855071.htm> (just
an example of course).

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #2
Mark Richards wrote:
For a table cell I want to have a padding of 3 pixel between the cell
border and the text inside. How do I specify this attribute in a <TD>
resp. css ?


The usual way:

td {
padding: 3px;
}

--
Jim Dabell

Jul 20 '05 #3
Mark Richards wrote:
For a table cell I want to have a padding of 3 pixel between the cell
border and the text inside. How do I specify this attribute in a <TD>
resp. css ?


td { padding: 3px; }

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #4
MH
> For a table cell I want to have a padding of 3 pixel ....
How do I specify this attribute in a <TD>...


'cellpadding' is a table, not a cell attribute, so why not just start a new
1x1 table in the cell and set the padding to 3px;
<td>
<table cellpadding="3">
<tr><td>3px padded cell</td></tr>
</table>
</td>

------
MH
Jul 20 '05 #5
MH wrote:
'cellpadding' is a table, not a cell attribute, so why not just start a
new 1x1 table in the cell and set the padding to 3px;


(a) Becuase it uses an insane quantity of markup
(b) Becuase its a pain to manage
(c) Becuase it lies about the semantics of the data
(d) Becuase its much much easier with CSS.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #6
On Sun, 4 Jan 2004, MH wrote:
why not just start a new 1x1 table in the cell and set the padding
to 3px;


Do you *really* need to ask? No wonder that web design is thought to
be a baroque and illogical black art that just sometimes happens to
produce the desired visual result, caring nothing for the underlying
mess.

Jul 20 '05 #7
On Sun, 04 Jan 2004 16:56:33 +0100, Mark Richards wrote:
For a table cell I want to have a padding of 3 pixel between the cell
border and the text inside. How do I specify this attribute in a <TD>
resp. css ?


td#humbug {
padding: 3px;
}

<td id="humbug">whatever</td>

--

..

Jul 20 '05 #8

"MH" <no****@nowhere.no> wrote in message
news:bt**********@news3.tilbu1.nb.home.nl...
For a table cell I want to have a padding of 3 pixel ....
How do I specify this attribute in a <TD>...
'cellpadding' is a table, not a cell attribute, so why not just

start a new 1x1 table in the cell and set the padding to 3px;
<td>
<table cellpadding="3">
<tr><td>3px padded cell</td></tr>
</table>
</td>


I'm assuming this would be OK if, within your tabular data, you
had a cell which itself was a set of table data. Otherwise it's
kind of a long way around when CSS works so much easier.
Jul 20 '05 #9
Mark Richards wrote:
For a table cell I want to have a padding of 3 pixel between the cell
border and the text inside. How do I specify this attribute in a <TD>
resp. css ?


td.somestyle { padding: 3px; }

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #10
MH
> .... Otherwise it's kind of a long way around when
CSS works so much easier.


I agree.
The OP asked how to do this using html or CSS, also in the group
news:comp.infosystems.www.authoring.html , there I gave him an answer for
the html part.

------
MH


Jul 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Graham J | last post by:
Apologies for the partial post that mysteriously escaped as I was composing. I shall try again. For many years I have been happily and successfully coding tables such that the WIDTH specified...
15
by: Mark Richards | last post by:
For a table cell I want to have a padding of 3 pixel between the cell border and the text inside. How do I specify this attribute in a <TD> resp. css ? Mark
9
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? ...
2
by: Bart Plessers \(artabel\) | last post by:
Hello, I need a style that defines -table cellspacing -table cellpading -alignment I tried <table class="TBLpageframe"> <tr class="TRpageframe">
7
by: Neil Zanella | last post by:
Hello, I have posted the following message before but got no replies... I am trying to format an HTML definition list with CSS so that it appears as follows, but am having the following problem:...
4
by: Wim Roffal | last post by:
On my webpage (http://www.classiccat.net/index.htm) I tried to transfer the cellpadding/spacing attributes to my stylesheet. However, somehow it doesn't work. I tried to look it up on the internet,...
7
by: Charles Law | last post by:
Can anyone convert the following C++ interface definition to VB.NET? I have had a go, but I cannot make the Load function work and the IsDirty function gives an error (Object not set to an...
1
by: yawnmoth | last post by:
Say I had a cellpadding of 3 but that for a single row in the table, I wanted a cellpadding of 0. Any ideas as to how I might go about doing this - as to how I might go about changing the...
2
by: Big Bill | last post by:
What's the CSS equivalent for that frequently found table coding? Roughly speaking? I know that speaking of equivalents can itself lead one into a semantic nightmare but, loosely speaking, what...
3
by: Seth Watson | last post by:
I've seen so many answers on the net I am not sure which one is right or if there's one answer that will work in all browsers First off - Table - cellspacing and cellpadding What is the CSS...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.