Re: Table Width Formula

by "Comharsa" <comharsa(at)clara.net>

 Date:  Mon, 19 Jun 2000 23:12:38 +0100
 To:  "Adrien Zamani" <azamani(at)design-matters.com>,
<hwg-basics(at)hwg.org>
 References:  matters
  todo: View Thread, Original
From: "Adrien Zamani"

>
> Hi every body,
> I have an Html Table having this properties :
> Border Size : b
> cellpadding : cp
> cellspacing : cs
> number of columns (<TD>) of a row : #cols
> Total width of columns in a row : total
>
> Is there any formula to calculate the width of this table ?

Not really as it stands as you do not have any information regarding the
width of the content in those table cells. However, if you assume that each
column contains content of equal width, and we call that "width", then it
will be something like:

total = #cols*width + (#cols+1)*b + #cols*cp*2 + (#cols-1)*cs

which can be simplified to:

total = #cols(width + b + 2cp + cs) + b - cs

I think... :-).

Brian
comharsa(at)clara.net

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA