Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 14th, 2006, 06:45 PM
Galethog@gmail.com
Guest
 
Posts: n/a
Default Revision bars in CSS?

I have a repository of aircraft technical documents that are converted
to HTML. The markup is incredibly ugly now because of the decision to
use table-based formatting. I'd like to remove everything from the
tables except, well, tables. The thing that has me stumped is that the
documents are required to display revision bars in the right-hand
margin alongside the data that has been changed since the previous
version. Of course, what was done was to add a narrow column to the
right and display the cell borders where necessary.

Does anyone know of a way to accomplish this same revision bar effect
with CSS instead of tables? Although sometimes there will need to be
revision bars to the right of particular rows of actual tables, in
addition to elements like paragraphs and list items.

I think this could be accomplished with Javascript, but I'd like to see
if there's a CSS-only solution to begin with.

  #2  
Old March 14th, 2006, 08:15 PM
Carolyn Marenger
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Galethog@gmail.com wrote:
[color=blue]
> I have a repository of aircraft technical documents that are converted
> to HTML. The markup is incredibly ugly now because of the decision to
> use table-based formatting. I'd like to remove everything from the
> tables except, well, tables. The thing that has me stumped is that the
> documents are required to display revision bars in the right-hand
> margin alongside the data that has been changed since the previous
> version. Of course, what was done was to add a narrow column to the
> right and display the cell borders where necessary.
>
> Does anyone know of a way to accomplish this same revision bar effect
> with CSS instead of tables? Although sometimes there will need to be
> revision bars to the right of particular rows of actual tables, in
> addition to elements like paragraphs and list items.
>
> I think this could be accomplished with Javascript, but I'd like to see
> if there's a CSS-only solution to begin with.[/color]

That is a good question. I haven't tried it, but I imagine you could create
a class for 'insert' and a class for 'delete' and include not only the
styling for the text but also an image, vertical bar, in the left or right
margin. it obviously wouldn't be any more automatic than specifying a
border in a table, but it should work.

Carolyn
--
Carolyn Marenger

  #3  
Old March 14th, 2006, 08:25 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Carolyn Marenger <cajunk@marenger.com> wrote:
[color=blue]
>That is a good question. I haven't tried it, but I imagine you could create
>a class for 'insert' and a class for 'delete'[/color]

Why? The ins and del elements are made for exactly that purpose.
[color=blue]
>and include not only the
>styling for the text but also an image, vertical bar, in the left or right
>margin.[/color]

Or specify border-right: 3px solid red; or similar? Why much about
with images?

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
  #4  
Old March 14th, 2006, 08:25 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Galethog@gmail.com wrote:
[color=blue]
> The thing that has me stumped is that the
> documents are required to display revision bars in the right-hand
> margin alongside the data that has been changed since the previous
> version.[/color]

If we limit ourselves to marking _blocks_ that way (and the approach you
describe implies such a limitation, too), it's fairly easy. Introduce a
class, say "chg", and use it for any changed block, e.g.
<p class="chg">Changed paragraph.</p>
or
<li class="chg">Changed list item</li>

In CSS, use e.g.

..chg { border-right: solid medium green; }

perhaps together with some right padding (to prevent text from hitting
the border) like

..chg { padding-right: 0.3em; }

In theory, you could use <ins> and <del> markup in HTML, but they imply
presentational idiosyncrasies (e.g., underlinking) that you would need
to fight against. Besides, they are really crappy markup for changes,
since they give no natural way for normal _changes_ (a paragraph
replaced by another one, for example).
  #5  
Old March 14th, 2006, 08:25 PM
Carolyn Marenger
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Steve Pugh wrote:
[color=blue]
> Carolyn Marenger <cajunk@marenger.com> wrote:
>[color=green]
>>That is a good question. I haven't tried it, but I imagine you could
>>create a class for 'insert' and a class for 'delete'[/color]
>
> Why? The ins and del elements are made for exactly that purpose.
>[color=green]
>>and include not only the
>>styling for the text but also an image, vertical bar, in the left or right
>>margin.[/color]
>
> Or specify border-right: 3px solid red; or similar? Why much about
> with images?
>
> Steve[/color]

Steve,

Why much about images? Simple. I didn't think of it. Your idea is a much
more elegant solution however.

Carolyn
--
Carolyn Marenger

  #6  
Old March 14th, 2006, 08:35 PM
Carolyn Marenger
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Jukka K. Korpela wrote:
[color=blue]
> Galethog@gmail.com wrote:
>[color=green]
>> The thing that has me stumped is that the
>> documents are required to display revision bars in the right-hand
>> margin alongside the data that has been changed since the previous
>> version.[/color]
>
> If we limit ourselves to marking _blocks_ that way (and the approach you
> describe implies such a limitation, too), it's fairly easy. Introduce a
> class, say "chg", and use it for any changed block, e.g.
> <p class="chg">Changed paragraph.</p>
> or
> <li class="chg">Changed list item</li>
>
> In CSS, use e.g.
>
> .chg { border-right: solid medium green; }
>
> perhaps together with some right padding (to prevent text from hitting
> the border) like
>
> .chg { padding-right: 0.3em; }
>
> In theory, you could use <ins> and <del> markup in HTML, but they imply
> presentational idiosyncrasies (e.g., underlinking) that you would need
> to fight against. Besides, they are really crappy markup for changes,
> since they give no natural way for normal _changes_ (a paragraph
> replaced by another one, for example).[/color]

Your solution is more elegant than mine was. I will however point out that
in any document revision control system that I have worked with, a strike
through denotes deleted text and underline denotes inserted text. Changed
text is denoted by striking through that which has been deleted and
underlining that which has been inserted in its place.

That works fine for content, but how does it work with styling or graphics?
Underlining does not always mean inserted. How do you strike through a
graphic?

Carolyn
--
Carolyn Marenger

  #7  
Old March 14th, 2006, 08:45 PM
Galethog@gmail.com
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

The problem I have with displaying a right-hand border is that I have
to account for table rows. Sometimes, whole tables need a revision bar
- but most often, revision bars are required for only certain rows of a
table.

  #8  
Old March 14th, 2006, 09:15 PM
Stan Brown
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Tue, 14 Mar 2006 15:00:42 -0500 from Carolyn Marenger
<cajunk@marenger.com>:[color=blue]
> I haven't tried it, but I imagine you could create
> a class for 'insert' and a class for 'delete' and include not only the
> styling for the text but also an image, vertical bar, in the left or right
> margin.[/color]

I was thinking along similar lines, but border-left or border-right
rather than an image.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
  #9  
Old March 14th, 2006, 10:05 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Carolyn Marenger <cajunk@marenger.com> wrote:
[color=blue]
> in any document revision control system that I have worked with, a strike
> through denotes deleted text and underline denotes inserted text.[/color]

That explains the common default rendering in browsers for <del> and <ins>,
but my point was that the default rendering is a problem. First, you cannot
be sure of overriding it; CSS is by definition optional suggestions only.
Second, there is no simple way to say in CSS that you wish to override
whatever defaults a browser has for some elements and then start setting up
your own styling for them. Instead, you need to set different properties
explicitly to neutral values, and there are many properties in CSS (and many
of them _could_ be used in default styling).
[color=blue]
> Changed
> text is denoted by striking through that which has been deleted and
> underlining that which has been inserted in its place.[/color]

Yes, but that's rather unnatural for indicating small changes and creates the
problem that the old text appears as deleted, instead of simple indication of
change.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
  #10  
Old March 14th, 2006, 11:05 PM
Chris Beall
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

Galethog@gmail.com wrote:[color=blue]
> I have a repository of aircraft technical documents that are converted
> to HTML. The markup is incredibly ugly now because of the decision to
> use table-based formatting. I'd like to remove everything from the
> tables except, well, tables. The thing that has me stumped is that the
> documents are required to display revision bars in the right-hand
> margin alongside the data that has been changed since the previous
> version. Of course, what was done was to add a narrow column to the
> right and display the cell borders where necessary.
>
> Does anyone know of a way to accomplish this same revision bar effect
> with CSS instead of tables? Although sometimes there will need to be
> revision bars to the right of particular rows of actual tables, in
> addition to elements like paragraphs and list items.
>
> I think this could be accomplished with Javascript, but I'd like to see
> if there's a CSS-only solution to begin with.
>[/color]

G,

The last example at http://www.w3.org/TR/CSS21/visuren.html#q28 might
give you a starting point. <span> brackets the changed text and the
marker is floated left (but could as well be right).

Chris Beall

  #11  
Old March 14th, 2006, 11:55 PM
Galethog@gmail.com
Guest
 
Posts: n/a
Default Re: Revision bars in CSS?

That was a very interesting and informative read. I'm not sure that it
takes me any closer, though. I've created a simplified example of the
problem here:

http://xnoubis.org/revbar.html

The revision bars are drawn vertically. I don't know in advance how
tall any of the revised rows will be. In a perfect world, I would be
able to style a TR element so that it drew a right border, say, 10
pixels to the right of its actual bounding box (sometimes in addition
to a regular right border, depending on the style of the table).

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles