Jump to content

td style= height: and background-color: prob


vmars316

Recommended Posts

Hello & Thanks ,

Need help, I can't figure out what's wrong with this code:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">
<html><head>
<meta charset="utf-8"><title>xRainbow-Project</title>
<style>
table td {border: 1px solid black; color: Black;}</style>
</head><body>
<TABLE>
<TR><TD style= "height: 50px; background-color: #E6E9FE &quote;>0,0,E6E9FE
<TR><TD style= "height: 50px; background-color: #E7EAFF &quote;>1,0,E7EAFF
</Table>
</body>
</html>
Thanks..vm

 

Link to comment
Share on other sites

You need to paste your code inside a <> code-block or some characters will get converted into codes.

 

Your table looks messed up. How many rows and how many columns do you want?

Link to comment
Share on other sites

You need to paste your code inside a <>

code-block 

or some characters will get converted into codes.

 

Your table looks messed up. How many rows and how many columns do you want?

 

It's not the lack of code block that caused this, this is his own code. Since &quote; is not actually a real HTML entity it's clear he typed that himself.

Link to comment
Share on other sites

Thanks,

I generate the code from a program .

Here is a sample of the code .

I can't hand the program any imbedded "

so I am using " instead .

 

Any suggestions ?

Thanks..vm

 

Procedure FileOut(OneLine$)   ; Input file  looks like this:          ; 41,1,E0FCE9        ; 42,1,E0FAE8        ;TBox02.s = "E0FCE9"   ; Output file looks like this        ;OneLine$ = TableRow     If FileOpen = 0   ;     MessageRequester("FileOpen = 0", "ColorTable.html")           If CreateFile(2, "ColorTable.html")           FileOpen = 1          WriteStringN(2,"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">")          WriteStringN(2,"<html><head>")          WriteStringN(2,"<meta charset="utf-8"><title>xRainbow-Project</title>")          WriteStringN(2,"<style>")          WriteStringN(2,"table td {border: 1px solid black; color: Black;}</style>")          WriteStringN(2,"</head><body>")             WriteStringN(2,TableBeg$)      Else                MessageRequester("PureBasic", "Error: can't Create file", 0)         End        EndIf  ; CreateFile(2,            EndIf  ; FileOpen = 0  
Link to comment
Share on other sites

" causes the HTML to not work.

 

In some languages escaping quotes is done with a backslash ("). This looks similar to ASP, I think in ASP you escape a quote by writing it twice: ""

Link to comment
Share on other sites

Hello & Thanks ,

Turns out I needed to create a DoubleQuote constant (#DQ$ = chr(34)) and then all went well .

Here is the winning line:

LTTD01$ = "<TR><TD style="+#DQ$+"height:50px; background-color:#"+TBox02dot$+";"+#DQ$+">"+OneLine$+"</TD>"
If anyone is interested, I am happy to Post the PureBasic code, 111 Lines.
Thanks All !..vm
Link to comment
Share on other sites

in simple language - what everyone above are saying is don't use any charcode for html. use the characters themselves..

 

not like what u wrote--

style= "height: 50px; background-color: #E6E9FE &quote;

 

in stead write --

style="height: 50px; background-color: #E6E9FE;"

Link to comment
Share on other sites

Thanks ,

The following line of PB (pure basic) that creates the proper html-code is this:

LTTD01$ = "<TR><TD style="+#DQ$+"height:50px; background-color:#"+TBox02dot$+";"+#DQ$+">"+OneLine$+"</TD>"

The code that Chrome (etc.) sees is this:

<TR><TD style="height:50px; background-color:#E6E9FE;">0,0,E6E9FE</TD>

I am happy with this.

 

I don't understand what you mean by "escape-code".

Thanks..vm

Link to comment
Share on other sites

This is the concept being referred to: http://en.wikipedia.org/wiki/Escape_character

 

You want to put a double-quote inside a string delimited by double-quotes. The solution is to use what's called an "escape sequence" or "escape character". Different programming languages have different ways to do it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...