473,594 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9982
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.annevankest eren.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">wha tever</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

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

Similar topics

7
12185
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 in a TD is the complete column width including any CELLPADDING. For example for a 400 pixel wide table with four 100 pixel wide columns and 10 pixel cellpadding... <TABLE WIDTH="400" BORDER="0" CELLSPACING="0" CELLPADDING="10">
15
3525
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
3740
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? Here is an example of just such a usage: <dl class="faq"> <di>
2
7937
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
4238
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: when the definition term (<dt>) on the left is too long, as in the HTML code posted below, the whole definition list gets messed up. I have tested the example with mozilla 1.2.1. Complete code is provided below so you can see what I mean. Anyone...
4
29379
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, but it seems to me that I am doing everything right, which is obviously not the case. It concerns the tables in the alphabetic part of the page. I have there a table-class "block" defined. It works fine in giving the tables their...
7
2361
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 instance). MIDL_INTERFACE("7FD52380-4E07-101B-AE2D-08002B2EC713") IPersistStreamInit : public IPersist { public: virtual HRESULT STDMETHODCALLTYPE IsDirty( void) = 0; virtual HRESULT STDMETHODCALLTYPE Load(/* */ LPSTREAM pStm) =
1
2099
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 cellpadding midway through a table and then restore it after that row?
2
4264
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 would you guys put? BB -- http://www.kruse.co.uk/internet-marketing-small-business.htm http://www.kruse.co.uk/close-ended-questions.htm
3
5409
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 equivalent for each? Is this also cross browser compatible? ** Posted from http://www.teranews.com **
0
8255
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8010
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6665
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.