Python Forum
Color a table cell based on specific text
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Color a table cell based on specific text
#2
Please post the code. What is html, html2 and html3?

Does the string replacement work, and the problem is this does not produce the desired result, or is the string replacement?

" is not the only way to quote a string.
html = html.replace("<thead>","""<thead style="background-color:#00FF00">""")
html3 = html3.replace('<td=TEXT B>', '<td style="background-color:##FF0000">')
Shouldn't the replacement string for '<td=TEXT B>' include 'TEXT B' somewhere?
Reply


Messages In This Thread
RE: Color a table cell based on specific text - by deanhystad - Jul-19-2023, 12:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 1,325 Oct-25-2023, 09:09 AM
Last Post: codelab
  Deleting rows based on cell value in Excel azizrasul 11 3,065 Oct-19-2022, 02:38 AM
Last Post: azizrasul
  Use module docx to get text from a file with a table Pedroski55 8 6,882 Aug-30-2022, 10:52 PM
Last Post: Pedroski55
  select Eof extension files based on text list of filenames with if condition RolanRoll 1 1,646 Apr-04-2022, 09:29 PM
Last Post: Larz60+
  Extracting Specific Lines from text file based on content. jokerfmj 8 3,301 Mar-28-2022, 03:38 PM
Last Post: snippsat
  How to perform DESC table sort on dates stored as TEXT type. hammer 7 2,470 Mar-15-2022, 01:10 PM
Last Post: hammer
  How to find tags using specific text (timestamps) in a url? q988988 1 1,474 Mar-08-2022, 08:09 AM
Last Post: buran
  Sum the values in a pandas pivot table specific columns klllmmm 1 4,858 Nov-19-2021, 04:43 PM
Last Post: klllmmm
  Extract text based on postion and pattern guddu_12 2 1,747 Sep-27-2021, 08:32 PM
Last Post: guddu_12
  Extract specific sentences from text file Bubly 3 3,615 May-31-2021, 06:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020